from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
import settings

admin.autodiscover()

urlpatterns = patterns('studenthoods.apps',
    (r'^admin/', include(admin.site.urls)),
    
    #world
    url(r'^$', 'world.views.index', name='home'),
    url(r'^how-it-works/$', 'world.views.how_it_works', name='how_it_works'),
    url(r'^details/$', 'world.views.details', name='details'),
    url(r'^faqs/$', 'world.views.faqs', name='faqs'),
    url(r'^about-us/$', 'world.views.about_us', name='about_us'),
    url(r'^privacy-policy/$', 'world.views.privacy_policy', name='privacy_policy'),
    url(r'^terms-and-conditions/$', 'world.views.terms_and_conditions', name='terms_and_conditions'),
    url(r'^our-hoodies/$', 'world.views.our_hoodies', name='our_hoodies'),
    url(r'^pricing/$', 'world.views.pricing', name='pricing'),
    url(r'^design-options/$', 'world.views.design_options', name='design_options'),

    #contact
    url(r'^contact-us/$', 'contact.views.contact', name='contact_us'),
    url(r'^contact-us/submitted/$', 'contact.views.contact_submitted', name='contact_us_submitted'),
    
    #feedback
    url(r'^feedback/$', 'feedback.views.feedback', name='feedback'),
    url(r'^feedback/submitted/$', 'feedback.views.feedback_submitted', name='feedback_submitted'),
    
    #facebook comps
    url(r'^facebook/(?P<app_id>[a-z0-9-]+)/$', 'facebook.views.competition', name='facebook_comp'),

)

if settings.TOGGLE_SHOP:
    urlpatterns += patterns('studenthoods.apps',
        url(r'^shop/(?P<slug_shop>[a-z0-9-]+)/(?P<slug_colour>[a-z0-9-]+)/$', 'shop.views.sizes', name='shop_sizes'),
        url(r'^shop/(?P<slug_shop>[a-z0-9-]+)/$', 'shop.views.shop', name='shop'),
        
        #order
        url(r'^order/return/(?P<hash>[a-zA-Z0-9-]+)/$', 'shop.views.paypal_return', name='shop_paypal_return'),
        url(r'^order/cancel-return/(?P<hash>[a-zA-Z0-9-]+)/$', 'shop.views.paypal_cancel_return', name='shop_paypal_cancel_return'),
        url(r'^order/(?P<hash>[a-zA-Z0-9-]+)/$', 'shop.views.paypal', name='shop_paypal'),
    )
    
    urlpatterns += patterns('',
        (r'^order/notify/frephe4t/', include('paypal.standard.ipn.urls')),
    )

urlpatterns += patterns('',
        (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
)

if settings.LOCAL:
   urlpatterns += patterns('',
        (r'^uploads/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
) 
